\(\int \csc ^3(e+f x) (-2+\sin ^2(e+f x)) \, dx\) [10]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 16 \[ \int \csc ^3(e+f x) \left (-2+\sin ^2(e+f x)\right ) \, dx=\frac {\cot (e+f x) \csc (e+f x)}{f} \]

[Out]

cot(f*x+e)*csc(f*x+e)/f

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.053, Rules used = {3090} \[ \int \csc ^3(e+f x) \left (-2+\sin ^2(e+f x)\right ) \, dx=\frac {\cot (e+f x) \csc (e+f x)}{f} \]

[In]

Int[Csc[e + f*x]^3*(-2 + Sin[e + f*x]^2),x]

[Out]

(Cot[e + f*x]*Csc[e + f*x])/f

Rule 3090

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[A*Cos[e
+ f*x]*((b*Sin[e + f*x])^(m + 1)/(b*f*(m + 1))), x] /; FreeQ[{b, e, f, A, C, m}, x] && EqQ[A*(m + 2) + C*(m +
1), 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\cot (e+f x) \csc (e+f x)}{f} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(107\) vs. \(2(16)=32\).

Time = 0.05 (sec) , antiderivative size = 107, normalized size of antiderivative = 6.69 \[ \int \csc ^3(e+f x) \left (-2+\sin ^2(e+f x)\right ) \, dx=\frac {\csc ^2\left (\frac {1}{2} (e+f x)\right )}{4 f}-\frac {\log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{f}+\frac {\log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{f}+\frac {\log \left (\sin \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{f}-\frac {\log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{f}-\frac {\sec ^2\left (\frac {1}{2} (e+f x)\right )}{4 f} \]

[In]

Integrate[Csc[e + f*x]^3*(-2 + Sin[e + f*x]^2),x]

[Out]

Csc[(e + f*x)/2]^2/(4*f) - Log[Cos[e/2 + (f*x)/2]]/f + Log[Cos[(e + f*x)/2]]/f + Log[Sin[e/2 + (f*x)/2]]/f - L
og[Sin[(e + f*x)/2]]/f - Sec[(e + f*x)/2]^2/(4*f)

Maple [A] (verified)

Time = 0.94 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.06

method result size
derivativedivides \(\frac {\cot \left (f x +e \right ) \csc \left (f x +e \right )}{f}\) \(17\)
default \(\frac {\cot \left (f x +e \right ) \csc \left (f x +e \right )}{f}\) \(17\)
parallelrisch \(\frac {1-\left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}\) \(32\)
risch \(-\frac {2 \left ({\mathrm e}^{3 i \left (f x +e \right )}+{\mathrm e}^{i \left (f x +e \right )}\right )}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{2}}\) \(38\)
norman \(\frac {\frac {\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {1}{4 f}-\frac {\tan ^{8}\left (\frac {f x}{2}+\frac {e}{2}\right )}{4 f}}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{2}}\) \(80\)

[In]

int(csc(f*x+e)^3*(-2+sin(f*x+e)^2),x,method=_RETURNVERBOSE)

[Out]

cot(f*x+e)*csc(f*x+e)/f

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.50 \[ \int \csc ^3(e+f x) \left (-2+\sin ^2(e+f x)\right ) \, dx=-\frac {\cos \left (f x + e\right )}{f \cos \left (f x + e\right )^{2} - f} \]

[In]

integrate(csc(f*x+e)^3*(-2+sin(f*x+e)^2),x, algorithm="fricas")

[Out]

-cos(f*x + e)/(f*cos(f*x + e)^2 - f)

Sympy [F]

\[ \int \csc ^3(e+f x) \left (-2+\sin ^2(e+f x)\right ) \, dx=\int \left (\sin ^{2}{\left (e + f x \right )} - 2\right ) \csc ^{3}{\left (e + f x \right )}\, dx \]

[In]

integrate(csc(f*x+e)**3*(-2+sin(f*x+e)**2),x)

[Out]

Integral((sin(e + f*x)**2 - 2)*csc(e + f*x)**3, x)

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.44 \[ \int \csc ^3(e+f x) \left (-2+\sin ^2(e+f x)\right ) \, dx=-\frac {\cos \left (f x + e\right )}{{\left (\cos \left (f x + e\right )^{2} - 1\right )} f} \]

[In]

integrate(csc(f*x+e)^3*(-2+sin(f*x+e)^2),x, algorithm="maxima")

[Out]

-cos(f*x + e)/((cos(f*x + e)^2 - 1)*f)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 45 vs. \(2 (16) = 32\).

Time = 0.29 (sec) , antiderivative size = 45, normalized size of antiderivative = 2.81 \[ \int \csc ^3(e+f x) \left (-2+\sin ^2(e+f x)\right ) \, dx=-\frac {\frac {\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}}{4 \, f} \]

[In]

integrate(csc(f*x+e)^3*(-2+sin(f*x+e)^2),x, algorithm="giac")

[Out]

-1/4*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) - (cos(f*x + e) - 1)/(cos(f*x + e) + 1))/f

Mupad [B] (verification not implemented)

Time = 12.86 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.44 \[ \int \csc ^3(e+f x) \left (-2+\sin ^2(e+f x)\right ) \, dx=-\frac {\cos \left (e+f\,x\right )}{f\,\left ({\cos \left (e+f\,x\right )}^2-1\right )} \]

[In]

int((sin(e + f*x)^2 - 2)/sin(e + f*x)^3,x)

[Out]

-cos(e + f*x)/(f*(cos(e + f*x)^2 - 1))